package com.schoolMall.utils;

import org.springframework.util.StringUtils;

/**
 * @author:zyh
 * @Time:2021-08-29-14:26
 * @email:1269231889@qq.com
 */
public class PathUtil {
    private static final String SEPARATOR = System.getProperty("file.separator");

    public static String getBasePath() {
        String property = System.getProperty("os.name");
        String basePath = "";
        if (property.toLowerCase().startsWith("win")) {
            basePath = "D:/桌面/项目/图片/";
        } else {
            basePath = "/home/kindnesslily/image/";
        }
        basePath = basePath.replace("/", SEPARATOR);
        return basePath;
    }

    public static String getShopImagePath(Long shopId) {
        String imagePath = getBasePath() + shopId + "\\";
        StringUtils.replace(imagePath,"/",SEPARATOR);
        return imagePath;
    }
}
